package ln.javatest.day07.demo13;

import java.util.ArrayList;

public class Demo01Main {
    public static void main(String[] args) {
        Manage mg = new Manage("群主",100);
        Menber mb = new Menber("成员A",0);
        Menber mb1 = new Menber("成员B",0);
        Menber mb2 = new Menber("成员C",0);

        mg.show();  //我叫群主，余额还剩：100
        mb.show();  //我叫成员A，余额还剩：0
        mb1.show(); //我叫成员B，余额还剩：0
        mb2.show(); //我叫成员C，余额还剩：0
        System.out.println("=====================");
        //发红包，20块钱分3份
        ArrayList<Integer> redList = mg.send(20,3);
        //三个群员收红包
        mb.receive(redList);
        mb1.receive(redList);
        mb2.receive(redList);
        mg.show();  //我叫群主，余额还剩：80
        mb.show();  //我叫成员A，余额还剩：8
        mb1.show(); //我叫成员B，余额还剩：6
        mb2.show(); //我叫成员C，余额还剩：6


    }
}
